import { del, get, post, put } from "../../../utils/request";
import { type AddParams, type AddResult, type ListParams, type ListResult } from "./type";

export const getHospitalizedList = (data: ListParams) => {
  return get<ListParams, ListResult>("/api/order/list", data);
};

export const delById = (id: number) => {
  return del<number, null>(`/api/order/delete/${id}`);
};

export const delMany = (ids: number[]) => {
  return post<number[], null>("/api/order/deleteAll", ids);
};

export const add = (data: AddParams) => {
  return post<AddParams, AddResult>("/api/order/add", data);
};
//获取单条
export const getModel = (id: number) => {
  return get<number, AddResult>(`/api/order/get/${id}`);
};
//修改
export const update = (data: AddParams) => {
  return put<AddParams, AddResult>("/api/order/update", data);
};
